namespace FIREFLYX {
    /** 普通深度 着色器*/
    export const BUILTIN_SHADER_BASE_DEPTH = `BaseDepth`;
    DefaultAsset.shaderGenMap[BUILTIN_SHADER_BASE_DEPTH] = () => {
        const vsCode = `#version 300 es
        precision mediump float;
        layout (location = 0) in vec4 a_Position; //顶点 位置 是有默认值的 (0,0,0,1)
        uniform ubo_model_block{
            mat4 u_mMtx;                //模型矩阵
        } uboModel;

        uniform mat4 u_viewProjMtx;

        void main() {
            gl_Position = u_viewProjMtx * uboModel.u_mMtx * vec4(a_Position.xyz,1.0);
        }
        `;

        const fsCode = `#version 300 es
        void main(){
            //only depth
         }
        `;
        //glsl
        const vs = new GLSL();
        vs.setCode(vsCode);
        const fs = new GLSL();
        fs.setCode(fsCode);

        //shader
        let result: Shader = new Shader();
        result.tag = BUILTIN_SHADER_BASE_DEPTH;
        result.lightMode = RenderPipeline.LM_FORWARD;
        result.vertexGLSL = vs;
        result.fragmentGLSL = fs;
        //unifrom 默认值
        result.definePropertyMap = {};

        //apply
        result.apply();

        return result;
    };
}